package ilo;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data

public class Godcard extends Card {
    private String cardname;
    private String[] wash ;

    public Godcard() {}

    public Godcard(String numble,String name, String telephone,double balance) {
        super(numble,name,telephone,balance);
        cardname = "金卡";
        wash = new String[100];
    }
    @Override
    public void consume(double money) {
        System.out.println("欢迎使用金卡客户服务");
        if (money > getBalance()) {
            System.out.println("余额不足");
        } else {
            setBalance(getBalance() - money*0.8);
            System.out.println("消费成功，余额为：" +getBalance() );
            wash_o(money);
        }

    }
    public void wash_o(double money){
        if (money>=200){
            System.out.println("恭喜您获得一次洗车服务");
            for (int i = 0; i < wash.length; i++) {
                if (wash[i] == null) {
                    wash[i] = "洗车";
                }
            }
        }
    }


}
